/*
 * @Author: your name
 * @Date: 2021-11-09 16:30:21
 * @LastEditTime: 2021-12-04 14:49:11
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\serve\config\config.default.js
 */
/* eslint valid-jsdoc: "off" */

"use strict";

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
    /**
     * built-in config
     * @type {Egg.EggAppConfig}
     **/
    //解除文件传输大小 避免传输文件不完整的情况   (图片gif图显示动效不完整)
    const config = (exports = {
        bodyParser: {
            //解除大小
            jsonLimit: "100mb",
            formLimit: "100mb",
        },
    });

    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + "_1636446602770_6847";

    // add your middleware config here
    config.middleware = [];

    // add your user config here
    const userConfig = {
        // myAppName: 'egg',
    };
    config.multipart = {
        mode: "file",
    };

    // // oss存储
    // config.oss = {
    //     // 这里需要的东西去自己的服务器里看，我用的阿里云
    //     client: {
    //         accessKeyId: "LTAI5tMgG5E6MJKiKdamXTTF",
    //         accessKeySecret: "hPk35wtyuEufQph2ulrdbcPZK02hPN",
    //         endpoint: "lzw929.oss-cn-shanghai.aliyuncs.com",
    //         bucket: "lzw929",
    //         timeout: "60s",
    //     },
    // };
    //配置支付信息
    config.payConfig = {
        // 沙箱环境的appId
        appId: "2021000118660285",
        // 私钥
        privateKey: "MIIEowIBAAKCAQEAlamNQEAHmd8eVHJgbVR46qxg8KUI/4crlXFhyA/McKuQZL0qhujJ3aaWPt30nHYzMGn1KGCErHWwimDiOdlLvV1cVVu3tFncxpKe/+/OSFAxVIZquAFBPUzRAKqJ85FAWxI4gtN02m+yGFlLentL23PMrZpZyVR8JSyld0ZG60PSLOVs7XPti7Cz3wxNhID49tH5zpY7qASxo2jBDQjlMgdSGi5om8mn3TI3TXQOqK+z7EhEiJteuQF4q7lQw/B1b7tB/i2Oft7J+L+7nBceVp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jsFCkC8X7XzMcEEbrAx0S+mHjWLuOOFAoGBANnwb9MzVzMysIQCSWe1FBrSxZYlkjpEgZD0Y72gTml5XjlMceXqbq7taEWe78iMR5W1jHdEflsAlPrazhkR0gv9+6QF1VvXP4A8Sguq/IYn8TH1LU99qtiz7sgxb266tXBCx2fUBYGC9P9IlcOAJYUwjrtVMlkR6Gn+MCvGni1L",
        // 支付宝公钥
        alipayPublicKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlamNQEAHmd8eVHJgbVR46qxg8KUI/4crlXFhyA/McKuQZL0qhujJ3aaWPt30nHYzMGn1KGCErHWwimDiOdlLvV1cVVu3tFncxpKe/+/OSFAxVIZquAFBPUzRAKqJ85FAWxI4gtN02m+yGFlLentL23PMrZpZyVR8JSyld0ZG60PSLOVs7XPti7Cz3wxNhID49tH5zpY7qASxo2jBDQjlMgdSGi5om8mn3TI3TXQOqK+z7EhEiJteuQF4q7lQw/B1b7tB/i2Oft7J+L+7nBceVp+i1izrwLjL87HgXES10xhs+WA6zrluJDVIpueHrSUyN97KpGXPJJJaVtkLLIva+QIDAQAB", // 支付宝公钥（不是应用公钥）
        // 签名类型
        signType: "RSA2", // RSA2
        gateway: "https://openapi.alipaydev.com/gateway.do", // 网关地址
        timeout: 5000, // 网关超时时间
        camelcase: true, // 是否把网关返回的下划线 key 转换为驼峰写法
    };
    exports.mysql = {
        // 单数据库信息配置a
        client: {
            // host
            host: "localhost",
            // 端口号
            port: "3306",
            // 用户名
            user: "root",
            // 密码
            password: "root",
            // 数据库名
            database: "creative-platform",
        },
        // 是否加载到 app 上，默认开启
        app: true,
        // 是否加载到 agent 上，默认关闭
        agent: false,
    };
    config.security = {
        csrf: false,
    };
    return {
        ...config,
        ...userConfig,
    };
};